package vistas;
import java.awt.BorderLayout;
import java.awt.event.ActionListener;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.SwingConstants;
import javax.swing.WindowConstants;
import javax.swing.border.BevelBorder;
import javax.swing.table.AbstractTableModel;

/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
@SuppressWarnings("serial")
public class FrmCalendario extends javax.swing.JFrame {

	private JPanel panelTablaCalendario;
	private JScrollPane scrollTablaCalendario;
	private JTable tablaCalendario;
	private JLabel lblTablaCalendario;
	private JButton btnVolver;
	
	
	/**
	* Auto-generated main method to display this JFrame
	*/
		
	public FrmCalendario() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			getContentPane().setLayout(null);
			{
				panelTablaCalendario = new JPanel();
				getContentPane().add(panelTablaCalendario, BorderLayout.CENTER);
				panelTablaCalendario.setBounds(20, 20, 660, 360);
				panelTablaCalendario.setLayout(null);				
				panelTablaCalendario.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
				{
					lblTablaCalendario = new JLabel();
					panelTablaCalendario.add(lblTablaCalendario);
					lblTablaCalendario.setText("Calendario");
					lblTablaCalendario.setBounds(20, 20, 620, 20);
					lblTablaCalendario.setFont(new java.awt.Font("Dialog",1,18));
					lblTablaCalendario.setHorizontalAlignment(SwingConstants.CENTER);
				}
				{
					scrollTablaCalendario = new JScrollPane();
					panelTablaCalendario.add(scrollTablaCalendario);
					scrollTablaCalendario.setBounds(20, 60, 620, 280);
					{
						tablaCalendario = new JTable();
						scrollTablaCalendario.setViewportView(tablaCalendario);
					}
				}
			}
			{
				btnVolver = new JButton();
				getContentPane().add(btnVolver);
				btnVolver.setText("Volver");
				btnVolver.setBounds(270, 400, 160, 50);
			}
			pack();
			setSize(700, 500);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}	
	
	public void agregarListener(ActionListener accion){
		btnVolver.addActionListener(accion);
	}
	
	public void setListado(AbstractTableModel abstractTableModel){
		tablaCalendario.setModel(abstractTableModel);
	}
	
	public void mostrarMensaje(String mensaje){
		JOptionPane.showMessageDialog(this, mensaje);
	}
	
}
